package com.huawei.common;

/**
 * @Author LF
 * projectName:vue-cli
 * description:
 * time:2025-04-25 23:08
 */
public enum BusinessCode {
    // 成功状态码
    SUCCESS(200, "操作成功"),

    // 客户端错误状态码
    BAD_REQUEST(400, "请求错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "未找到资源"),

    // 服务器错误状态码
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用");

    private final int code;
    private final String message;

    BusinessCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
